Skip to content

fix(supabase): reject non-string url and key in create_client - #2065

Merged
spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2831-reject-non-string-url-and-key
Nov 16, 2026
Merged

spydon merged 2 commits into
mainfrom
lukasklingsbo/sdk-2831-reject-non-string-url-and-key

Conversation

@spydon

@spydon spydon commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Ports the v2 fix from #1926 to v3. SDK-2831

  • A non-string supabase_url or supabase_key now raises SupabaseException with a clear message instead of a raw AttributeError or TypeError.
  • One shared check in SupabaseClient covers both the async and sync client.
  • The create_client and create_async_client factories run the check before creating an HTTP session, like they already do for request_timeout.
  • Tests assert the message for every invalid url and key, for both clients and all three factories.

@coderabbitai

coderabbitai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 8 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d4d72a4c-c2af-47c8-8b18-d803bad78084
Commits

Reviewing files that changed from the base of the PR and between 6f2ba79 and 8c84382.

Files selected for processing: 4

  • src/supabase/src/supabase/aiohttp.py
  • src/supabase/src/supabase/client.py
  • src/supabase/src/supabase/httpx.py
  • src/supabase/tests/test_client.py

No actionable comments were generated in the recent review.

Summary

Summary by CodeRabbit

  • Bug Fixes
    • Client setup now reports clearer errors when the URL or key is missing or has an invalid type.

The client constructor now validates that the URL and key are strings and are not falsey. Parameterized sync and async tests cover invalid URL and key inputs and check the reported SupabaseException messages.

Change: Bug fix

Merge Risk: Minimal · previous review 6f2ba

The change makes invalid URL or key arguments raise a clear SupabaseException instead of a raw AttributeError or TypeError. Tests cover the new behavior, and no merge-blocking risk is apparent.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: bd8eb0c7-3a0e-463b-b736-1fe0021337a4
Commits

Reviewing files that changed from the base of the PR and between 439735e and 6f2ba79.

Files selected for processing: 2

  • src/supabase/src/supabase/client.py
  • src/supabase/tests/test_client.py

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 2 remain after this review.

@spydon
spydon merged commit c49d791 into main Nov 16, 2026
23 checks passed
@spydon
spydon deleted the lukasklingsbo/sdk-2831-reject-non-string-url-and-key branch November 16, 2026 11:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant